using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmMasContact")]
    public class MasContact
    {
        public MasContact()
        {
        }

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "ConId", ResourceType = typeof(Resources.MasContactResource))]
        public int ConId { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "NameTh", ResourceType = typeof(Resources.MasContactResource))]
        public string NameTh { get; set; }

        [DataMember, Display(Name = "NameEng", ResourceType = typeof(Resources.MasContactResource))]
        public string NameEng { get; set; }

        [CustomRequired]
        [DataMember]
        public int ConCategory { get; set; }

        [CustomRequired]
        [ForeignKey("ContactGroup")]
        [DataMember, Display(Name = "ConGrpId", ResourceType = typeof(Resources.MasContactResource))]
        public int ConGrpId { get; set; }

        [DataMember, Display(Name = "TaxCode", ResourceType = typeof(Resources.MasContactResource))]
        public string TaxCode { get; set; }

        [DataMember, Display(Name = "RegistedDate", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<System.DateTime> RegistedDate { get; set; }

        [DataMember, Display(Name = "RegistedCapital", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<decimal> RegistedCapital { get; set; }

        [DataMember, Display(Name = "GfmisCode", ResourceType = typeof(Resources.MasContactResource))]
        public string GfmisCode { get; set; }

        [DataMember, Display(Name = "Coordinator", ResourceType = typeof(Resources.MasContactResource))]
        public string Coordinator { get; set; }

        [ForeignKey("VatType")]
        [DataMember, Display(Name = "VatTypeId", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<int> VatTypeId { get; set; }

        [ForeignKey("ContactStatus")]
        [DataMember, Display(Name = "ConStatusId", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<int> ConStatusId { get; set; }

        [DataMember, Display(Name = "StatRemarks", ResourceType = typeof(Resources.MasContactResource))]
        public string StatRemarks { get; set; }

        [DataMember, Display(Name = "Country", ResourceType = typeof(Resources.MasContactResource))]
        public string Country { get; set; }

        [DataMember, Display(Name = "Building", ResourceType = typeof(Resources.MasContactResource))]
        public string Building { get; set; }

        [DataMember, Display(Name = "Floor", ResourceType = typeof(Resources.MasContactResource))]
        public string Floor { get; set; }

        [DataMember, Display(Name = "Village", ResourceType = typeof(Resources.MasContactResource))]
        public string Village { get; set; }

        [DataMember, Display(Name = "Address", ResourceType = typeof(Resources.MasContactResource))]
        public string Address { get; set; }

        [DataMember, Display(Name = "Road", ResourceType = typeof(Resources.MasContactResource))]
        public string Road { get; set; }

        [DataMember, Display(Name = "Lane", ResourceType = typeof(Resources.MasContactResource))]
        public string Lane { get; set; }

        [DataMember, Display(Name = "District", ResourceType = typeof(Resources.MasContactResource))]
        public string District { get; set; }

        [DataMember, Display(Name = "Amphur", ResourceType = typeof(Resources.MasContactResource))]
        public string Amphur { get; set; }

        [DataMember, Display(Name = "Postal", ResourceType = typeof(Resources.MasContactResource))]
        public string Postal { get; set; }

        [DataMember, Display(Name = "Province", ResourceType = typeof(Resources.MasContactResource))]
        public string Province { get; set; }

        [DataMember, Display(Name = "Tel", ResourceType = typeof(Resources.MasContactResource))]
        public string Tel { get; set; }

        [DataMember, Display(Name = "TelNext", ResourceType = typeof(Resources.MasContactResource))]
        public string TelNext { get; set; }

        
        [DataMember, Display(Name = "Fax", ResourceType = typeof(Resources.MasContactResource))]
        public string Fax { get; set; }

        [DataMember, Display(Name = "FaxNext", ResourceType = typeof(Resources.MasContactResource))]
        public string FaxNext { get; set; }

        [DataMember, Display(Name = "Email", ResourceType = typeof(Resources.MasContactResource))]
        public string Email { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.MasContactResource))]
        public string RecordStatus { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.MasContactResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }



		[DataMember]
        public virtual IcmMasLookUp ContactGroup { get; set; }

		[DataMember]
        public virtual IcmMasLookUp ContactStatus { get; set; }

		[DataMember]
        public virtual IcmMasLookUp VatType { get; set; }

        public enum ContactCategory
        {
            IcmContact = 1,
            FimContact = 2,
            Other = 99
        }
    }
}